package com.qijian.maindata.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qijian.maindata.domain.Team;
import com.qijian.maindata.domain.query.TeamQuery;
import com.qijian.maindata.domain.vo.TeamVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import com.qijian.maindata.domain.TeamMember;

import java.util.List;

/**
 * 生产班组Mapper接口
 *
 * @author qijian
 * @date 2025-04-01
 */
public interface TeamMapper extends BaseMapper<Team> {

    @Select("select count(0) from fm_team WHERE create_time >= CURRENT_DATE ")
    int countCurrentDateWithDel();

    Page<TeamVo> selectPageVo(Page<Team> page, @Param(Constants.WRAPPER) Wrapper<TeamQuery> queryWrapper);

    List<TeamVo> selectPageVo(@Param(Constants.WRAPPER) Wrapper<TeamQuery> queryWrapper);

    void saveDetail(@Param("teamMemberList") List<TeamMember> teamMemberList);

    void delDetail(Long teamId);

    TeamVo getInfoById(@Param("teamId") Long teamId);

    int updateTeam(@Param("param") Team team);
}
